const Index = () => import('@/views/AppIndex');
const UserChatList = () => import('@/views/UserChatList');
const UserChatIndex = () => import('@/views/UserChatIndex');
const UserChatDetail = () => import('@/views/UserChatDetail');
const AppSite = () => import('@/views/AppSite');
const UserList = () => import('@/views/UserList');
const UserDetail = () => import('@/views/UserDetail');

const dynamicRouter = [
    {
        path: '/index',
        name: 'Index',
        component: Index,
        meta: {requireLogin: true},
        power: [1, 2, 3],
        children: [
            {
                path: '',
                name: 'UserChatList',
                component: UserChatList,
                meta: {requireLogin: true},
                power: [1, 2, 3],
                children: [
                    {
                        path: '',
                        name: 'UserChatIndex',
                        component: UserChatIndex,
                        meta: {requireLogin: true},
                        power: [1, 2, 3],
                    },
                    {
                        path: 'user-chat-detail/:id(.*)',
                        name: 'UserChatDetail',
                        component: UserChatDetail,
                        meta: {requireLogin: true},
                        power: [1, 2, 3],
                    }
                ]
            },
            {
                path: 'user',
                name: 'UserList',
                component: UserList,
                meta: {requireLogin: true},
                power: [1, 2, 3],
                children: [
                    {
                        path: '',
                        name: 'UserListIndex',
                        component: UserChatIndex,
                        meta: {requireLogin: true},
                        power: [1, 2, 3],
                    },
                    {
                        path: 'detail/:userId(.*)',
                        name: 'UserDetail',
                        component: UserDetail,
                        meta: {requireLogin: true},
                        power: [1, 2, 3],
                    }
                ]
            },
            {
                path: 'site',
                name: 'AppSite',
                component: AppSite,
                meta: {requireLogin: true},
                power: [1, 2, 3]
            }
        ]
    }
];

export default dynamicRouter;